
//
//  OrderExpertCell.m
//  DaJiang
//
//  Created by sally on 16/10/10.
//  Copyright © 2016年 jiniu. All rights reserved.
//

#import "OrderExpertCell.h"

@interface OrderExpertCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headImage;
@property (weak, nonatomic) IBOutlet UILabel *themeLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation OrderExpertCell

- (void)awakeFromNib {
  [self initControl];
}

- (void)initControl {
  self.headImage.layer.cornerRadius = self.headImage.height / 2;
  self.headImage.layer.masksToBounds = YES;
}

- (void)setCellData:(TopicModel *)cellData {
  self.themeLabel.text = cellData.data.topic_name;
  self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f", cellData.data.topic_price];
}

- (void)setCellUserData:(UserData *)cellUserData {
  [self.headImage sd_setImageWithURL:[NSURL URLWithString:cellUserData.user_profile_pic] placeholderImage:[UIImage imageNamed:@"ic_default"]];
  self.nameLabel.text = cellUserData.user_name;
}

- (void)setCellOrderData:(OrderModel *)cellOrderData {
  [self.headImage sd_setImageWithURL:[NSURL URLWithString:cellOrderData.op_data.pro_user_profile_pic] placeholderImage:[UIImage imageNamed:@"ic_default"]];
  self.nameLabel.text = cellOrderData.op_data.pro_user_name;
  self.themeLabel.text = cellOrderData.op_data.pro_topic_name;
  self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f", cellOrderData.op_data.pro_topic_price];
}

@end
